package topday1_9.mxdx9;

/**
 * @Auther:小陈的Java
 * 设计圆类
 */
public class Circle {
    private static double PI = Math.PI;
    private double radius;

    public Circle(double radius) {
        this.radius = radius;
    }

    public double getArea() {
        //return Circle.PI*radius*radius;
        //在本类中调用静态属性和方法可以省略类名.。
        return PI * radius * radius;
    }

    public static void main(String[] args) {
        Circle circle = new Circle(5.5);
        System.out.println(circle.getArea());
        Circle circle1 = new Circle(6.6);
        System.out.println(circle1.getArea());

    }
}
